<!-- Custom Style -->
<?php
include "../proses/konek.php";
session_start();
if(!isset($_SESSION['username']))
   {   
  ?><script language="javascript">alert('anda blm login');
document.location='../'</script><?php 
}
else
{
$username = $_SESSION['username'];
$status = $_SESSION['status'];
}
?>
<html>
<head >
<meta content="IE=edge" http-equiv="X-UA-Compatible"></meta>

<meta content="width=device-width, initial-scale=1" name="viewport"></meta>

<meta content="" name="description"></meta>

<meta content="" name="author"></meta>
<title>E-Learning of TetraSMA</title>
	<!-- sidebar css --> 
    <link rel="stylesheet" type="text/css" href="../css/sidebar.css">
    <!-- bootstrap css -->
    <link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/bootstrap-theme.min.css">
	<link rel="stylesheet" type="text/css" href="../css/timeline.css">
	<link rel="stylesheet" type="text/css" href="../css/meisMenu.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap/css/profile.css">
	
	<!-- navbar -->
<?php	
	require_once('../render.php');
	$render=new render;
	$render->navigasi();
	$render->icon();
	
	$render->profile($status, $username);
	
?>

</head>

<body style="overflow-x:hidden; " class="background">

<!-- menu samping -->

<div id="wrapper" >
	<div id="sidebar-wrapper" >
			<?php
			include ('menuslide.php');
			$menu=new menu;
			$menu->init($username, $status);
			?>
	</div>

		<div id="page-content-wrapper">
			<div class="container-fluid">
				<div class="row" style="margin-top:40px">
					<div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
								<?php
								/*select table*/
								$sql = mysql_query("SELECT * FROM posting where author='ADMIN' ORDER BY idpost DESC LIMIT 1 ");
								/*cetak table*/
								if($row=mysql_num_rows($sql))
								{
								while ($admin = mysql_fetch_assoc($sql)) {
									?>
						<div class="col-md-10 col-sm-9" >
			              	  <h3 ><?php
										print ($admin['judul']);
									?></h3>
				              <div class="row">
				                <div class="col-xs-9 " >
				                  <p><?php
											print ($admin['isi']);
										?></p>
				                  <p class="lead">
				                  	
				                  	<a href="view.php? id=<?php echo $admin['idpost']?>">
				                  		<button class="btn btn-default">Read More</button>
				                  	</a>
				                  </p>
				                  </div>
				                <div class="col-xs-3"></div>
				              </div>
			              
			            </div>
									<?php
								}
							}
							?>
					</div>
				</div>
					
				<div class="row" style="margin-top:80px">
					<div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
						
							<?php
								/*select table*/
								$result = mysql_query("SELECT * FROM posting WHERE author <> 'ADMIN' ORDER BY idpost DESC LIMIT 5");
								/*cetak table*/
								while ($list = mysql_fetch_assoc($result)) {
									
							?>
					          
						  <div class="row">    
				            <br>
				            <div class="col-md-2 col-sm-3 text-center">
				              <a class="story-img" href="viewprofile.php?e=<?php echo $list['author']?>"><img src="<?php 
				              	$img=mysql_query("SELECT img FROM guru where email= '$list[author]' ");
								$rsimg= mysql_fetch_array($img);

				              echo $rsimg['img'] ?>" style="width:100px;height:100px" class="img-circle"></a>
				            </div>
				            <div class="col-md-10 col-sm-9" >
				              <a href="view.php? id=<?php echo $list['idpost']?>"><h3 ><?php
											print ($list['judul']);
										?></h3></a>
				              <div class="row">
				                <div class="col-xs-9 " >
				                  <p><?php
											print ($list['isi']);
										?></p>
				                  <p class="lead">
				                  	
				                  	<a href="view.php? id=<?php echo $list['idpost']?>">
				                  		<button class="btn btn-default">Read More</button>
				                  	</a>
				                  </p>
				                  <p class="pull-right"><span class="label label-default"><?php echo $list['kategori']?></span> <span class="label label-default"><?php echo $list['kelas']?></span> </p>
				                  <!-- <ul class="list-inline"><li><a href="#">2 Days Ago</a></li><li><a href="#"><i class="glyphicon glyphicon-comment"></i> 4 Comments</a></li><li><a href="#"><i class="glyphicon glyphicon-share"></i> 34 Shares</a></li></ul> -->
				                  </div>
				                <div class="col-xs-3"></div>
				              </div>
				              
				            </div>
				            <br><br>
				          </div>
				          <?php
									
								} // end while
							?>
					</div>
	                						
							
				</div>

			</div>

		</div>
</div>
<div >
<?php
			$render->footer();
			?>
	
</div>

<!-- JQuery Core -->
<script src="../js/search.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../css/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="../js/metisMenu.min.js"></script>
<script src="../js/sb-admin-2.js"></script>
<script type="text/javascript" src="../js/sidebar.js"></script>


</body>
</html>

	
